package com.xyy.saas.payment.merchant.core.dto;

import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.extern.log4j.Log4j;

@Data
@Log4j
public class BatchUploadImgDto {
    /**
     * 构建对象
     * @param merchantNo
     * @param custMerchantNo
     * @param clientSerialNo
     * @param files
     * @return
     */
    public static BatchUploadImgDto build(String merchantNo, String custMerchantNo, String clientSerialNo, String files) {
        BatchUploadImgDto batchUploadImgDto = new BatchUploadImgDto();
        batchUploadImgDto.setMerchantNo(merchantNo);
        batchUploadImgDto.setCustMerchantNo(custMerchantNo);
        batchUploadImgDto.setClientSerialNo(clientSerialNo);
        batchUploadImgDto.setFiles(files);
        return batchUploadImgDto;
    }

    /**
     * 商户号
     */
    private String merchantNo;
    /**
     * 调用方用户ID
     */
    private String custMerchantNo;
    /**
     * 日志流水号
     */
    private String clientSerialNo;
    /**
     * 将图片压缩成zip包后转成base64字符串传入此字段
     */
    private String files;

    /**
     * 组装JSON请求参数
     * @return
     */
    public String getJSONStringParam() {
        JSONObject object = new JSONObject();
        object.put("merchant_no", getMerchantNo());
        object.put("cust_merchant_no", getCustMerchantNo());
        object.put("client_serial_no", getClientSerialNo());
        object.put("files", getFiles());
        return object.toJSONString();
    }
}
